﻿// -----------------------------------------------------------------------------
// Generate By Furion Tools v2.16.0                            
// -----------------------------------------------------------------------------

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using HOPU.OnlineSchool.Core;

namespace HOPU.OnlineSchool.Core
{
    public partial class CmsBanner : IEntity<MasterDbContextLocator>, IEntityTypeBuilder<CmsBanner, MasterDbContextLocator>
    {
    
        public string Id { get; set; }
        public string Title { get; set; }
        public string ImageUrl { get; set; }
        public string LinkUrl { get; set; }
        public int Sort { get; set; }
        public byte IsDeleted { get; set; }
        public DateTime GmtCreate { get; set; }
        public DateTime GmtModified { get; set; }
    
        public void Configure(EntityTypeBuilder<CmsBanner> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
                entityBuilder.ToTable("cms_banner");

                entityBuilder.HasComment("首页banner表");

                entityBuilder.HasIndex(e => e.Title, "uk_name")
                    .IsUnique();

                entityBuilder.Property(e => e.Id)
                    .HasMaxLength(19)
                    .HasColumnName("id")
                    .HasDefaultValueSql("''")
                    .IsFixedLength(true)
                    .HasComment("ID");

                entityBuilder.Property(e => e.GmtCreate)
                    .HasColumnName("gmt_create")
                    .HasComment("创建时间");

                entityBuilder.Property(e => e.GmtModified)
                    .HasColumnName("gmt_modified")
                    .HasComment("更新时间");

                entityBuilder.Property(e => e.ImageUrl)
                    .IsRequired()
                    .HasMaxLength(500)
                    .HasColumnName("image_url")
                    .HasDefaultValueSql("''")
                    .HasComment("图片地址");

                entityBuilder.Property(e => e.IsDeleted)
                    .HasColumnName("is_deleted")
                    .HasComment("逻辑删除 1（true）已删除， 0（false）未删除");

                entityBuilder.Property(e => e.LinkUrl)
                    .HasMaxLength(500)
                    .HasColumnName("link_url")
                    .HasDefaultValueSql("''")
                    .HasComment("链接地址");

                entityBuilder.Property(e => e.Sort)
                    .HasColumnType("int unsigned")
                    .HasColumnName("sort")
                    .HasComment("排序");

                entityBuilder.Property(e => e.Title)
                    .HasMaxLength(20)
                    .HasColumnName("title")
                    .HasDefaultValueSql("''")
                    .HasComment("标题");
        }

    }
}
